package com.jcnet.bizaia;
import com.actionbarsherlock.view.MenuItem;
import com.jcnet.bizaia.bean.VoiceInfoBean;
import com.squareup.picasso.Picasso;

import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
public class VoiceDetailAcitvity extends JCSimpleSherlockActivity {
	
	private VoiceInfoBean voiceInfoBean;
	
	private ImageView radioImageView;
	
	private TextView radioTextView;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.voice_detail_lay);
		
		voiceInfoBean = (VoiceInfoBean) getIntent().getSerializableExtra("radioInfo");
		
		
		super.jcTitle = getString(R.string.voiceDetail);
		
		initView();
		
		initActionBar();
	}
	
	
	private void initView() {
		// TODO Auto-generated method stub
		radioImageView = (ImageView)findViewById(R.id.radioImg);
		
		radioTextView = (TextView)findViewById(R.id.radioInfo);
		
		if(voiceInfoBean!=null){
			radioTextView.setText(voiceInfoBean.getCname()+"\n\r"+voiceInfoBean.getDateline()+"\n\r"+voiceInfoBean.getContent());
		}
		
		Picasso.with(VoiceDetailAcitvity.this).load(App.HTTP_PATH+voiceInfoBean.getAcsimages()).centerCrop().resize(120	, 80).into(radioImageView);
	}


	@Override
	public boolean onCreateOptionsMenu(com.actionbarsherlock.view.Menu menu) {
		// TODO Auto-generated method stub
		//getSupportMenuInflater().inflate(R.menu.menu_with_download, menu);
		
		/* menu.add("download")
         .setIcon(R.drawable.menus_bgg)
         .setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);*/
		return super.onCreateOptionsMenu(menu);
	}
	
	
	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// TODO Auto-generated method stub
		if(item.getTitle().equals("download")){
			Toast.makeText(VoiceDetailAcitvity.this, "download...", 0).show();
		}
		return super.onOptionsItemSelected(item);
	}
}
